<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../../print.css" type="text/css" media="print">
<meta content="BaseComponent,org.computus.ui.core.BaseComponent,destroy,draw,init,invalidate" name="keywords">
<title>org.computus.ui.core.BaseComponent</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'BaseComponent - The Computus Engine API Documentation';
				var baseRef = '../../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">The Computus Engine API</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../index-list.html')" href="../../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../../index.html?org/computus/ui/core/BaseComponent.html&amp;org/computus/ui/core/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;BaseComponent</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class BaseComponent"); titleBar_setSubNav(false,false,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">org.computus.ui.core</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class BaseComponent</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">BaseComponent <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../../../images/inherit-arrow.gif"> flash.display.MovieClip</td>
</tr>
</table>
<p></p>
  The BaseComponent class is intended to be used as a base class for other AS3 MovieClips.
  The class is light and simple and aims to simplify garbage and render management of custom AS3 MovieClips and components.
  
  <p>implements "Garbage Management" through standardised and automated init() and destroy() functions</p>
  <p><b>init()</b><br/>
  This function is automatically called when the component is added to the stage either by placing it on the timeline or by addChild() in AS3.
  You should place all your initialisation code and add any listeners here.</p>
  
  <p><b>destroy()</b><br/>
  This function is automatically called when the component is removed from the stage either by removing it from the timeline or by removeChild() in AS3.
  You should place all your cleanup code and remove any listeners here.</p>
    
  <p>implements "deferred rendering" through invalidate() and draw()<p> 
  <p><b>invalidate()</b><br/>
  This function can be used to queue a draw() request at the next available frame.</p>
  
  <p><b>draw()</b><br/>
  This function can be used to redraw the state of a complicated component. It can either be called directly or buffered and scheduled by calling the invalidate() command.
  You should place any state redraw code here.</p>
    <p></p>
<br>
<hr>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#BaseComponent()">BaseComponent</a>()</div>
<div class="summaryTableDescription">
   Creates a new instance of the BaseComponent() class.</div>
</td><td class="summaryTableOwnerCol">BaseComponent</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#destroy()">destroy</a>():void</div>
<div class="summaryTableDescription">
   Removes all listeners and prepares the class for disposal.</div>
</td><td class="summaryTableOwnerCol">BaseComponent</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#draw()">draw</a>():void</div>
<div class="summaryTableDescription">
   This function can be called directly to force a redraw of the component.</div>
</td><td class="summaryTableOwnerCol">BaseComponent</td>
</tr>
</table>
</div>
<a name="protectedMethodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Protected Methods</div>
<table id="summaryTableProtectedMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#init()">init</a>():void</div>
<div class="summaryTableDescription">
   This function is called whenever the component is added to the DisplayList.</div>
</td><td class="summaryTableOwnerCol">BaseComponent</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#invalidate()">invalidate</a>():void</div>
<div class="summaryTableDescription">
   Calling this function schedules a call to the draw() command.</div>
</td><td class="summaryTableOwnerCol">BaseComponent</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="BaseComponent()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">BaseComponent</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function BaseComponent()</code><p>
   Creates a new instance of the BaseComponent() class.
   </p></div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="destroy()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">destroy</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function destroy():void</code><p>
   Removes all listeners and prepares the class for disposal.
   
    </p><p>This function is called whenever the component is removed from the DisplayList. 
   Concrete classes should always override this function. The overridden function should contain everything required to cleanly dispose of the component. This can include any of the following:
   <ul><li> Dispose of any child components</li>
   <li>remove all listeners</li>
   <li>stop all sounds</li>
   <li>release all references to cameras and microphones.</li>
   <li>call clearInterval() on any currently running intervals</li>
   <li>call stop() on any running Timer objects</li>
   <li>Close any connected network objects, such as instances of: Loader, URLLoader, Socket, XMLSocket, LocalConnection, NetConnections, and NetStream.</li></ul><p>
   </div>
<a name="draw()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">draw</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function draw():void</code><p>
   This function can be called directly to force a redraw of the component. The recommended way of managing redraws is to store the state changes and call invalidate() which will buffer requests to avoid overloading draw().
   
   </p><p>Concrete classes should always override this function. The overridden function should contain everything required to redraw the state of the component. This can include any of the following:
   <ul><li>redraw size</li>
   <li>redraw position</li>
   <li>redraw state etc...</li></ul><p>
   </div>
<a name="init()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">init</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function init():void</code><p>
   This function is called whenever the component is added to the DisplayList. 
   
   </p><p>Concrete classes should always override this function. The overridden function should contain everything required to initialise the component. This can include any of the following:
   <ul><li>manage any child components</li>
   <li>add any event listeners</li>
   <li>initialise any intervals</li>
   <li>initialise any Timers</li>  
   <li>draw() state if neccessary</li></ul><p>
   </div>
<a name="invalidate()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">invalidate</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function invalidate():void</code><p>
   Calling this function schedules a call to the draw() command. Use invalidate() rather than calling draw() directly to avoid making unneccessary redraws.
   </p></div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright">MMIX | John Dalziel  | The Computus Engine  |  www.computus.org  |  All source code licenced under the MIT Licence</center>
</div>
</body>
</html>
<!--MMIX | John Dalziel  | The Computus Engine  |  www.computus.org  |  All source code licenced under the MIT Licence-->
